﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SyndicateDAO.DAO;
using SyndicateDAO.DatabaseObject;

namespace SyndicateBusiness.Classes
{
    public class SyndicateBL
    {
        private SyndicatesDAO SyndicatesDAO = new SyndicatesDAO();

        public syndicate GetSingle(int sId)
        {
            return SyndicatesDAO.SelectSingle(sId);
        }

        public syndicate GetCurrentSyndicate()
        {
            return SyndicatesDAO.SelectAll().SingleOrDefault(s => s.isCurrent);
        }

        public syndicate GetSingleByUserId(int uId)
        {
            return SyndicatesDAO.SelectSingleByUserId(uId);
        }

        public bool InserSyndicate(syndicate s)
        {
            return SyndicatesDAO.InserSyndicate(s);
        }
        public bool UpdateSyndicate()
        {
            return SyndicatesDAO.UpdateSyndicate();
        }
        public bool DeleteSyndicate(syndicate s)
        {
            return SyndicatesDAO.DeleteSyndicate(s);
        }
    }
}
